package com.atguigu.tingshu.account.rpc;

import com.atguigu.tingshu.account.service.UserAccountService;
import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.vo.account.AccountLockResultVo;
import com.atguigu.tingshu.vo.account.AccountLockVo;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description:
 *
 * @author Yanxinhao on 2025/2/12
 */
@RestController
@RequestMapping("/api/account/rpc")
public class RpcUserAccountController {

    @Autowired
    private UserAccountService userAccountService;


    /**
     * 锁定用户账户金额
     * @param accountLockVo 锁定数据对象
     * @return
     */
    @PostMapping("/checkAndLockAccountMoney")
    @Operation(summary = "锁定用户账户金额")
    Result<AccountLockResultVo> checkAndLockAccountMoney(@RequestBody AccountLockVo accountLockVo){
        Result<AccountLockResultVo> result = userAccountService.checkAndLockAccountMoney(accountLockVo);
        return result;
    }
}